//
//  QiangDanCommitVC.m
//  OrderSys
//
//  Created by JM on 15/10/12.
//  Copyright © 2015年 zjlskj. All rights reserved.
//

#import "QiangDanCommitVC.h"
#import "STPopup.h"
#import "MJCellAll.h"
@interface QiangDanCommitVC ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic,retain)NSMutableArray * cellArray;
@end

@implementation QiangDanCommitVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    //pop
    self.contentSizeInPopup = CGSizeMake(300, 280);
    self.landscapeContentSizeInPopup = CGSizeMake(400, 200);
    
    NSInteger x = self.view.frame.origin.x;
    NSInteger y = self.view.frame.origin.y;
    NSInteger w = self.view.frame.size.width;
   
    UILabel *leabel = [[UILabel alloc] initWithFrame:CGRectMake(x, y, w, 20)];
    leabel.text = @"备注：";
    self.tableView.tableHeaderView = leabel;
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    button.frame = CGRectMake(0, 10, 300, 30);
    [button setTitle:@"确认抢单" forState:UIControlStateNormal];
    [button addTarget:self action:@selector(clickQueryQiangDan:) forControlEvents:UIControlEventTouchUpInside];
    self.tableView.tableFooterView = button;
    
    //
    self.title = @"抢单";
    self.cellArray = [NSMutableArray array];
    MJCell *cell = nil;
    
    cell = [TextViewCell cell];
    [self.cellArray addObject:cell];
    
    
    cell = [LabelTimeCell cellWithLabel:@"预计到达时间：" tableView:self.tableView];
    [self.cellArray addObject:cell];
   
//    cell = [LabelSelectCell cellWithLabel:@"车辆类型" forSelectArray:@[@"货车",@"自卸车",@"冷藏车",@"油罐车",@"保温车",@"起重车",@"中型罐车",@"铁笼车",@"进口气囊避震车",@"不锈钢大槽罐车"] tableView:self.tableView];
//    [self.cellArray addObject:cell];
//    
//    cell = [LabelTimeCell cellWithLabel:@"订单结束时间" tableView:self.tableView];
//    [self.cellArray addObject:cell];
//    
//    cell = [JMEdietrCell cellWithLabelText:@"sdsds" keyboardType:UIKeyboardTypeDefault placeholder:@""];
//    [self.cellArray addObject:cell];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableViewz{
    return 1;
}
- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.cellArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    return self.cellArray[indexPath.row];
    
    //    NSString *ID = @"ddddd";
    //    LabelSelectCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    //    if (!cell){
    //        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
    //        cell.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"圆箭头-50x50向下.png"]];
    //    }
    //    //赋值
    //    cell.textLabel.text = self.leftArray[indexPath.row];
    //    // cell.textLabel.text = @"密码修改";
    //    return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    MJCell *cell = self.cellArray[indexPath.row];
    return [cell height] ;
}

#pragma mark-delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    MJCell *cell = self.cellArray[indexPath.row];
    [cell didSelect];
    
}

- (void)clickQueryQiangDan:(id)sender {
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}

@end
